package com.service.impl;

import com.dao.Dao;
import com.dao.UserDao;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//@Service一般是用来放在Service业务层上面的
//Spring扫描到会去创建对应的bean
@Service
public class UserServiceImpl implements UserService {
    //Spring 自动注入
    @Autowired
    //当Spring中bean有多个相似的类型 自动装配不能识别 可以手动指定一个
    @Qualifier(value = "goodsDao")
    Dao dao;

    @Override
    public void save() {
        dao.save();
    }

    @Override
    public void delete() {
        dao.delete();
    }
}
